package org.xxpay.core.service;

import org.xxpay.core.entity.PayPassageAccount;

import java.util.List;
import java.util.Map;

/**
 * @author: dingzhiwei
 * @date: 18/5/3
 * @description: 支付通道账户
 */
public interface IPayPassageAccountService {

    int add(PayPassageAccount payPassageAccount);

    int addByTC(PayPassageAccount payPassageAccount, List<String> accountNoList);

    int update(PayPassageAccount payPassageAccount);

    int updateByTC(PayPassageAccount payPassageAccount, List<String> accountNoList);

    PayPassageAccount findById(Integer id);

    List<PayPassageAccount> select(int offset, int limit, PayPassageAccount payPassageAccount);

    Integer count(PayPassageAccount payPassageAccount);

    List<PayPassageAccount> selectAll(PayPassageAccount payPassageAccount);

    /**
     * 根据支付通道ID,查询所有支付通道账户列表
     * @param payPassageId
     * @return
     */
    List<PayPassageAccount> selectAllByPassageId(Integer payPassageId);

    List<PayPassageAccount> selectAllByPayOrderCount(Integer payPassageId);

    List<PayPassageAccount> selectAllByPayOrderTime(Integer payPassageId);

    List<PayPassageAccount> selectAllByPayOrderAmount(Integer payPassageId);

    /**
     * 得到子账号按照权重（子账号对应总订单数量排序）
     * @param payPassageId
     * @param pollOrderTime
     * @return
     */
    List<PayPassageAccount> selectAllByPayOrderPollWeight(Integer payPassageId, Integer pollOrderTime);

    List<Map> selectList(int i, int pageSize, Integer payPassageId, Byte status, String createTimeStart, String createTimeEnd, boolean isOnlySupplier);

    /** 根据id删除 **/
    int deleteByIds(List<Integer> ids);

    int updateByExample(PayPassageAccount payPassageAccount);

}
